window: unset menubar before unsetting focus on dispose()
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 14 Oct 2014 13:30:34 +0000 (15:30 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 14 Oct 2014 13:47:06 +0000 (15:47 +0200)
commit1ae5c2a138546d12d2782b4175c1e4e69296defa
treeafdcf8f487e745342d2a712985c20acc503b9421
parente0040acefc2f5b7a8f781192654b28b021467e88
window: unset menubar before unsetting focus on dispose()

If the menubar has an app-menu popover, and it is shown at the time of
disposing the window, it will attempt to transfer focus back to the
previous focus widget when undoing modality, even though the dispose()
code already did set_focus(NULL) previously.

At the time the popover is removed, there aren't many hints as to whether
the toplevel or the focus widget are being destroyed (ie. not still under
in_destruction), so just swap the order of these two calls.

For every other popover, this would all happen within dispose/destroy,
which is handled better.
gtk/gtkwindow.c